﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace NExt.Handler.Base.Default
{
    public class DefaultHandler : IHttpHandler, IRequiresSessionState
    {
        private readonly bool isReusable;
        private readonly IResponseBuilder responseBuilder;

        public DefaultHandler(bool isReusable, IResponseBuilder responseBuilder)
        {
            this.isReusable = isReusable;
            this.responseBuilder = responseBuilder;
        }

        public bool IsReusable
        {
            get { return isReusable; }
        }

        public void ProcessRequest(HttpContext context)
        {
            responseBuilder.Build(context);
        }
    }
}
